#ifndef INPUTELEMENT_H_INCLUDED
#define INPUTELEMENT_H_INCLUDED

#include "ConfigElement.h"

#define INPUT_TAG                   "input"
#define INPUT_NAME_ATTRIBUTE        "name"

#define INPUT_OPTION_TAG            "option"
#define INPUT_OPTION_NAME_ATTRIB    "name"
#define INPUT_OPTION_VALUE_ATTRIB   "value"

namespace OpenNano
{
    typedef std::map<std::string, std::string> InputOptionsMap;

    class OPENNANO_EXPORT InputElement : public ConfigElement
    {
        DECLARE_OBJECT_FACTORY( InputElement );

        private:
            std::string _name;
            bool _everything_is_good_so_far;
            InputOptionsMap _options;


        protected:
            void attributeFound(TiXmlAttribute * attribute );
            void childElementFound( TiXmlElement * childElement );
            void textFound(const char * text);
            bool postConfiguration();
            void init();

        public:
            const std::string& getName() const;
            const InputOptionsMap& getOptions() const;
            bool getOption(const std::string& name, std::string &value);

    };



}


#endif // INPUTELEMENT_H_INCLUDED
